/**
 * Created by Administrator on 2017/2/11.
 */
import { Component,OnInit } from '@angular/core';
import { Router, ActivatedRoute, Params } from '@angular/router';
import {FactoryuploadService } from './factoryupload.serve';


@Component({
    moduleId: module.id,
    selector: 'my-upload',
    templateUrl: 'factoryupload.html',
    providers:[ FactoryuploadService ]
})
export class UploadComponent implements OnInit {
  constructor(
    private route: ActivatedRoute,
    private router: Router,
    private FactoryuploadService:FactoryuploadService,
  ) {}
  private inf='';
  private falist='';
  private errorMessage='';
  private userid='';
  ngOnInit() {
    this.route.params
      .subscribe((params: Params) => {
        this.inf = params['samename'];
      });
      let userid = this.userid;
      this.FactoryuploadService.faclist()
          .subscribe(
              res=>{
                  this.falist=res;
                  console.log(this.falist)
              },
              error =>this.errorMessage = <any>error
          )
  }
    //去制造厂姓名
    godetail(id:number,facname:string){
        this.router.navigate(['/linkFacdetail',id,facname]);
    }

  moreLink =false;
  more(){
    if (this.moreLink==true){
      this.moreLink=false
    }else {
      this.moreLink=true
    }
  }
}
